package com.campus.payment.feign;

import com.campus.common.bean.common.Resp;
import com.campus.payment.dto.RefundRequestDTO;
import com.campus.payment.dto.RefundResponseDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 退款服务Feign客户端
 *
 * @author ZhaoYuJie
 * @since 2025-01-15
 */
@FeignClient(name = "campus-payment", contextId = "refund-client", url = "${feign.campus-payment.url:http://localhost:8085}")
public interface RefundFeignClient {

    /**
     * 申请退款
     */
    @PostMapping("/refund/apply")
    Resp<RefundResponseDTO> applyRefund(@RequestBody RefundRequestDTO refundRequestDTO);

    /**
     * 根据订单ID查询退款记录
     */
    @GetMapping("/refund/order/{orderId}")
    Resp<RefundResponseDTO> getRefundByOrderId(@PathVariable("orderId") String orderId);

}